<?php 
use \PsiFramework\Classes\Util\UI\Printer;
use \PsiFramework\Classes\Util\UI\HTML;
use \PsiFramework\Classes\Factory\DAOFactory;
use \PsiFramework\Applications\AlloMediaPortal\Classes\Model\InformationPart;
use \PsiFramework\Applications\AlloMediaUser\Classes\Actions\ShopAction;

$order = $response->getAttribute('order');
$currencySymbol = $order->getCurrency()->getSymbol();
$orderArray = ShopAction::getOrder($order, true);
$items = $orderArray['items'];

if (count($items)>0) {
?>
<div id="panierHover">
	<div class="fenetreXt">
		<div class="centre">
			<div class="panier-element<?php if (count($items)>3) { ?> scroll-pane<?php } ?>">
				<ul>
    				<?php
                    foreach ($items as $itemArray) {
                        $responseId = $itemArray['item'] ;
                        $quantity = $itemArray['quantityLabel'];
                        $price = $itemArray['price'];
                        $itemName = $itemArray['itemName'];
                        $itemId = $itemArray['id'];
                        
                        $entryId = $responseId->getEntry()->getId();
                        $formId = $responseId->getTheme()->getId();
                        $categoryId = $responseId->getEntry()->getCategory()->getId();
                        
                        $itemLink = 'action=ShowTheme&entry_id='.$entryId.'&form_id='.$formId.'&category_id='.$categoryId;
                        
                    ?>
					<li class="elem">
						<span class="img-produit"><?php
            			if (!is_null($responseId->getTheme()->getComplementImage())) {
            			?><a href="<?php echo HTML::linkHref($itemLink) ?>"><img src="<?php Printer::display($responseId->getTheme()->getComplementImage()->getImageLink()); ?>" width="75px" height="75px" alt="" /></a><?php 
            			}
            			?></span>
						<span class="titre"><?php 
						echo HTML::link(
								$itemName,
								$itemLink,
								array(
										'title'=>$languageManager->getText('SHOW_ITEM')
								)
						);
						?></span>
						<span class="prix"><?php Printer::display(number_format($price, 2, '.', ' ').$currencySymbol); ?></span>
						<span class="duree"><?php Printer::display($quantity); ?></span>
						<?php
						echo HTML::link(
					        '',
					        'action=DeleteBasketItem&order_item_id='.$itemId,
					        array(
				                'class'=>'sup',
				                'title'=>$languageManager->getText('DELETE_FROM_BASKET')
			                )
				        );
						?>
					</li>
    				<?php
                    }
                    ?>
				</ul>
			</div>
			<?php echo HTML::link($languageManager->getText('GO_TO_BASKET'), 'action=ShowBasket', array('class'=>'btn')); ?>
		</div>
		<div class="fleche"></div><div class="haut-gauche coin"></div><div class="haut-centre"></div><div class="haut-droite coin"></div><div class="centre-gauche bord"></div><div class="centre-droite bord"></div><div class="bas-gauche coin"></div><div class="bas-centre"></div><div class="bas-droite coin"></div>
	</div>
</div>
<?php
}
?>